<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('专家管理列表')"/>
    <th:block th:include="include :: bootstrap-select-css"/>

</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>专家姓名：</label>
                            <input type="text" name="expertName"/>
                        </li>

                        <!--                            <li>-->
                        <!--                                <label>曾任职务：</label>-->
                        <!--                                <input type="text" name="positions"/>-->
                        <!--                            </li>-->
                        <!--                            <li class="select-time">-->
                        <!--                                <label>受聘年份：</label>-->
                        <!--                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginEmploymentTime]"/>-->
                        <!--                                <span>-</span>-->
                        <!--                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endEmploymentTime]"/>-->
                        <!--                            </li>-->
                        <li>
                            <label>审读范围：</label>
                            <select name="reviewScope" class=" noselect2 selectpicker"
                                    th:with="type=${@dict.getType('re_review_scope')}"
                                    data-none-selected-text="请选择审读范围">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>

                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-select-js"/>

<script th:inline="javascript">
    var prefix = ctx + "publish/managementt";

    $(function () {
        var options = {
            url: prefix + "/listmoney",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            modalName: "专家列表",
            striped: true,    //是否显示行间隔色
            clickToSelect: true, //是否启用点击选中行
            columns: [{
                radio: true
            },
                {
                    field: 'id',
                    title: '专家id',
                    // visible: false
                },
                {
                    field: 'expertName',
                    title: '专家姓名'
                },
                {
                    field: 'by1',
                    title: '联系电话'
                },
                {
                    field: 'employmentTime',
                    title: '受聘年份',
                    formatter: function (value, row, index) {
                        return value;
                    }
                },
                {
                    field: 'positions',
                    title: '曾任职务'
                },
                {
                    field: 'reviewScope',
                    title: '审读范围'
                },
                {
                    field: 'reviewedNumber',
                    title: '已审样本数'
                },
                {
                    field: 'manuscriptFee',
                    title: '稿费'
                },
            ]
        };
        $.table.init(options);
    });

    /* 添加-选择-提交 */
    function submitHandler() {
        // var rows = $.table.selectFirstColumns();
        var rows = $.table.selectColumns('id');
        var names = $.table.selectColumns('expertName');
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }

        var _r  = $("#bootstrap-table").bootstrapTable('getSelections');
        //alert(rows.join());
        console.log(_r);
        $.modal.close();
        // 父页面的方法
        // parent.selectUsers();
        // 父页面的变量
        parent.setExpert(rows.join(),names.join());
        //parent.$('#userids').html(rows.join());
    }
</script>
</body>
</html>